/// Represents the statistics of a mailbox.
#[derive(Debug, Clone)]
pub struct MailboxStats {
    pub messages_processed: usize,
    pub messages_queued: usize,
    pub messages_dropped: usize,
    pub avg_processing_time: f64, // Example metric
    pub avg_queuing_time: f64,     // Example metric
    pub errors: usize,              // Example metric
    pub status_changes: usize,      // Example metric
}

impl MailboxStats {
    pub fn new() -> Self {
        Self {
            messages_processed: 0,
            messages_queued: 0,
            messages_dropped: 0,
            avg_processing_time: 0.0,
            avg_queuing_time: 0.0,
            errors: 0,
            status_changes: 0,
        }
    }

    pub fn increment_processed(&mut self) {
        self.messages_processed += 1;
    }

    pub fn increment_queued(&mut self) {
        self.messages_queued += 1;
    }

    pub fn increment_dropped(&mut self) {
        self.messages_dropped += 1;
    }

    pub fn update_avg_processing_time(&mut self, time: f64) {
        self.avg_processing_time = (self.avg_processing_time + time) / 2.0; // Simple average
    }
} 